#!/bin/sh
{% set profile = cookiecutter.template_profile -%}
{% set agent_worktrees = cookiecutter.enable_agent_worktrees == "yes" or (cookiecutter.enable_agent_worktrees == "profile_default" and profile in ["agent_assisted", "github_sdlc", "software_factory"]) -%}
set -eu

{% if agent_worktrees -%}
# Agent worktree guard — blocks commits in the protected main clone
python3 scripts/agent_worktree.py guard --quiet

# Agent instruction drift — keeps all agent files referencing AGENTS.md
python3 scripts/ci/check_agent_instruction_drift.py --quiet 2>/dev/null || \
  echo "warning: agent instruction drift detected — run make ci-local-governance"

{% endif -%}
# Version bump guard — prevents version bumps outside release/* branches
python3 scripts/ci/check_version_bump.py
